#include "../../../common/logger.hpp"
#include "../../../common/asr.hpp"
#include <iostream>
#include <json/value.h>
#include <gflags/gflags.h>
#include <string>

DEFINE_string(app_id, "120026913", "语音平台应用ID");
DEFINE_string(api_key, "p3Lx8iu85TfbuB5YKtW6i6Rp", "语音平台API密钥");
DEFINE_string(secret_key, "rroIaIozRXpjgLgXtijlGWnMa2fGG03m", "语音平台加密密钥");

DEFINE_bool(run_mode, false, "程序的运行模式, false-调试 true-发布");
DEFINE_string(log_file, "", "发布模式下，指定日志的输出文件");
DEFINE_int32(log_level, 0, "发布模式下，指定日志输出等级");

int main(int argc, char* argv[])
{
    google::ParseCommandLineFlags(&argc, &argv, true);
    init_logger(FLAGS_run_mode, FLAGS_log_file, FLAGS_log_level);

    ASRClient client(FLAGS_app_id, FLAGS_api_key, FLAGS_secret_key);

    std::string file_content;
    aip::get_file_content("16k.pcm", &file_content);

    std::string ret = client.recognize(file_content);
    std::cout << ret << '\n';
    return 0;
}